package gov.pbc.nn.kjgl.task.dao;

import java.util.Map;

import org.springframework.stereotype.Component;

import com.bstek.bdf2.core.business.IUser;
import com.bstek.bdf2.core.context.ContextHolder;
import com.bstek.dorado.data.provider.Criteria;
import com.bstek.dorado.data.provider.Page;

import gov.pbc.nn.core.bdf.IUserSelect;
import gov.pbc.nn.core.bdf.entity.Dept;
import gov.pbc.nn.core.utils.SecurityUtils;
import gov.pbc.nn.kjgl.Constants;

@Component("userSelectKzDao")
public class UserSelectKzDao implements IUserSelect {

	@Override
	public void loadUsers(Page<IUser> page, Criteria criteria, Map<String, Object> params) throws Exception {
		int type = Integer.parseInt(params.get("type").toString());
		if (type == 0) {
			// 南宁
			SecurityUtils.getUserByRoleForDeptWithChildren(
					((Dept) ContextHolder.getLoginUser().getDepts().get(0)).getCDept().getId(),
					Constants.ROLE_TASK_FENBAN, page);
		} else {
			// 地市
		}
	}

}
